Skip to content

pointer dataflow #1630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 24, 2023
Merged

pointer dataflow #1630

merged 4 commits into from
May 24, 2023

Conversation

Fil
Copy link
Contributor

@Fil Fil commented May 24, 2023

closes #1628

todo:

  • I made it a function for now, but I think we wanted to write this as a listener instead?
  • the UX could be improved (currently we have to click-to-stick, click-to-unstick, move, click again; see click-click #1540)
  • handle multiple pointers
  • needs documentation

demo: https://observablehq.com/@observablehq/plot-dispatchvalue-1630

@Fil Fil requested a review from mbostock May 24, 2023 15:56
Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to dispatch whenever the focused index changes (on render when i !== ii) rather than requiring a click.

We also need to figure out some strategy (or documentation?) for when there are multiple pointers. Dispatching a separate input event for each pointer means they will compete to set the value. So either context.dispatchValue could do some debouncing, or the pointer transforms could coordinate with each other to avoid competition (like the coordination they do for rendering using requestAnimationFrame). Probably easiest if context.dispatchValue handled it.

@mbostock mbostock force-pushed the fil/pointer-dataflow branch from b020568 to fbcb797 Compare May 24, 2023 17:38
@mbostock mbostock marked this pull request as ready for review May 24, 2023 18:04
@mbostock mbostock enabled auto-merge (squash) May 24, 2023 18:04
@mbostock mbostock merged commit fd5e0d5 into main May 24, 2023
@mbostock mbostock deleted the fil/pointer-dataflow branch May 24, 2023 18:04
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* closes observablehq#1628

* dispatch on render

* textarea

* “debounce”

---------

Co-authored-by: Mike Bostock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The pointer transform should support Observable’s viewof
2 participants